Page 3 of 3 FirstFirst 123
Results 21 to 28 of 28

Thread: Push player with a bash possible?

  1. #21

    Default

    As far as I can tell your script just sets the bash to perform the push, but there's no actual trigger or target so when you bash it's just gonna perform the action. I have no information to offer on this, as I am but a noob lol. Maybe spawn a trigger at the players viewangles at time of the bash?

    My push laser spawns a laser and glues a trigger_push to the laser target(end of the laser)

    I'm just guessin here, cuz sometimes the wrong idea helps lead to the right fix

    Sorry I can't be of more help lol

  2. #22

  3. #23

    Default

    Executing scripts from the torso is definitely not my strong point, but after a little tinkering.. I did NOT add what I did to the [local.f] area, just [local.i], so when i tested with 2 players only 1 could bash with the 5000 speed, the other player only did the 200 power bash, but he did not move, just his target. so clean this up how you wish and add it to the bottom where i didn't. Let me know how this works for you, it worked perfect for me.
    Code:
    main:
    
    
    	for (local.i = 1; local.i <= local.default.size; local.i++)
    	{
    		local.t = local.default[local.i][1]
    		if (level.push[local.t] == NIL)
    		{
    			level.push[local.t] = local.default[local.i][2]
    		}
    	}
    
    
    	thread push_2
    
    end
    
    push_2:
    
    	local.power = 200
    for (local.i = 1; local.i <= $player.size; local.i++)
    	{
    	for (local.f = $player.size; local.f > 0; local.f--)
    	      {
    
    		if ($player[local.i].fireheld == 1)
    		   {
                            //lets give it direction...
    		 	local.start = $player[local.i] gettagposition "eyes bone"
    			local.fwd_vec = angles_toforward $player[local.i].viewangles 
    			local.target = (trace local.start (local.start + ( local.fwd_vec * 10000 ))) //<- 10,000 = range of your bash trigger
    
    			local.trig = spawn trigger_push angle self.angle //<- push trigger go
    			local.trig.origin = local.target
    			local.trig speed 5000 // <- how far it will push, 5000 was for testing
    			wait 0.15 //small wait, doesn't matter how short, longer wait will make trigger stay long after bash
    			local.trig remove //delete trigger when we're done
    		//	local.dir = (angles_toforward $player[local.i].viewangles)
    		//	$player[local.i] pusher $player[local.f] $player[local.f] local.target local.power 
    		   }
    		else if ($player[local.f].fireheld == 1)
    	           {
    			local.dir = (angles_toforward $player[local.f].viewangles)
    			$player[local.i] pusher $player[local.f] $player[local.f] local.dir local.power 
    		   }
                  }
             }
    
    end

  4. #24
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    In a script executed from the statefile, self, referred to implicitly or explicitly, is the player in question. In this case it is the player who pushes.
    So you'd need
    $player[local.i] pusher self self (angles_toforward self.viewangles) local.power
    where
    $player[local.i]
    is the player that is pushed.
    Last edited by Sor; June 29th, 2015 at 03:41 PM.
    Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.

  5. #25

    Default

    didnt work gotcha, if i turn down the push speed it still hits me to another planet lol :P

  6. #26

    Default

    I don't understand. Here's everything I've got.... and this is a video I just made of the results.. https://www.youtube.com/watch?v=0ed1...ature=youtu.be

    mike_torso.st
    Code:
    // Pistol whip for silent kills
    state ATTACK_PISTOL_SECONDARY
    {
    	movetype legs
    
    	entrycommands
    	{
    		viewmodelanim fire_secondary 1
    		exec global/slim.scr
    	}
    and here's the full slim.scr, with my edit added fully and cleaned up
    Code:
    //Slimbips push bash mod
    
    main:
    
    
    	for (local.i = 1; local.i <= local.default.size; local.i++)
    	{
    		local.t = local.default[local.i][1]
    		if (level.push[local.t] == NIL)
    		{
    			level.push[local.t] = local.default[local.i][2]
    		}
    	}
    
    
    	thread push_2
    
    end
    
    push_2:
    
    for (local.i = 1; local.i <= $player.size; local.i++)
    	{
    	for (local.f = $player.size; local.f > 0; local.f--)
    	      {
    
    		if ($player[local.i].fireheld == 1)
    		   {
    		 	local.start = $player[local.i] gettagposition "eyes bone"
    			local.fwd_vec = angles_toforward $player[local.i].viewangles 
    			local.target = (trace local.start (local.start + ( local.fwd_vec * 10000 )))
    			local.trig = spawn trigger_push angle self.angle
    			local.trig.origin = local.target
    			local.trig speed 5000
    			waitframe
    			local.trig remove
    		   }
    		else if ($player[local.f].fireheld == 1)
    	           {
    		 	local.start = $player[local.i] gettagposition "eyes bone"
    			local.fwd_vec = angles_toforward $player[local.i].viewangles 
    			local.target = (trace local.start (local.start + ( local.fwd_vec * 10000 )))
    			local.trig = spawn trigger_push angle self.angle
    			local.trig.origin = local.target
    			local.trig speed 5000
    			waitframe
    			local.trig remove 
    		   }
                  }
             }
    
    end

  7. #27

    Default

    yeah works awesome thanks
    it has some bugs but its quite where i was looking for :P
    if u want to test it so u can see where it was ment for try this ip 193.192.58.191:12121
    the mod starts as soon there is 1 allies

    only thing i have to do is add more moving stuff around the whole map and my Rat Race mod is finished... thanks for help!!

  8. #28

    Default

    Anytime Slim, always happy to be of some help. What kind of bugs are you experiencing? Depending on what they are you might try making the trigger bigger, changing the speed, or go from waitframe to a slightly longer wait. Maybe glue the trigger to the target before removal as well. These are just ideas as I haven't seen the bugs yet. But I will check it out soon.

Page 3 of 3 FirstFirst 123

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •